package uuid;

import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.uuid.Generators;
import org.apache.commons.lang3.StringUtils;

import java.util.UUID;

/**
 * @Author zhangtao
 * @create 2022/3/14 17:30
 */
public class IdGenerator {
    public static void main(String[] args) {
        //Generate time-based UUID
        UUID uuid1 = Generators.timeBasedGenerator().generate();
        System.out.println("UUID : " + uuid1);
        System.out.println("UUID Version : " + uuid1.version());
        System.out.println("UUID Variant : " + uuid1.variant());

        //Generate random UUID
        UUID uuid2 = Generators.randomBasedGenerator().generate();
        System.out.println("UUID : " + uuid2);
        System.out.println("UUID Version : " + uuid2.version());
        System.out.println("UUID Variant : " + uuid2.variant());
    }
}
